package main

import (
	"chapter4/src/lhLog"
	"fmt"
	"time"
)

/**
 * Created with Goland
 * User: 令狐飞侠
 * Date: 2021-12-6
 * Description: 测试logrus 驱动函数
 */
func main() {
	fmt.Println("logrus:")

	lhLog.InitLogger()

	fmt.Println("日志级别:")
	lhLog.LHDebug("find a debug...")
	lhLog.LHInfo("find a info message...")
	lhLog.LHWarn("find a warn...")
	lhLog.LHError("find an error...")

	//fmt.Println("打印文件名和函数名:")
	//lhLog.SetInfoAddFunctionName(true)
	//lhLog.LHInfo("Stack Overflow...")

	//fmt.Println("输出到文件:")
	//lhLog.SetInfoOutputFile(true)
	//lhLog.LHInfo("tack Overflow...")

	//fmt.Println("JSON格式输出:")
	//lhLog.LHKafkaInfo("weather", "temperature 26℃","receive a weather message...")

	fmt.Println("日志切割分离:")
	lhLog.Rotate()
	for {
		lhLog.LHInfo("hello, world!")
		time.Sleep(time.Duration(30) * time.Second)
	}
}
